﻿@model Bricks.Site.Models.QualityPlanView

@{
    ViewBag.Title = "预览知识管理";
    Layout = "~/Views/Shared/_UserPage.cshtml";
}

@*引入uEditor*@
<script type="text/javascript" charset="utf-8" src="/Res/ueditor/ueditor.config.js"></script>
<script type="text/javascript" charset="utf-8" src="/Res/ueditor/ueditor.all.js"> </script>
<script type="text/javascript" charset="utf-8" src="/Res/ueditor/lang/zh-cn/zh-cn.js"></script>
<link rel="stylesheet" type="text/css" href="/Res/ueditor/themes/default/css/ueditor.css" />

<script>
    $(function () {
        $.MiniUEditorInit($("#hID").val(), "QualityManagement/QualityPlanList/AbstractDescription", "abstractDescription", 620, 150, true);  //迷你加载
    });
</script>

@*实现对EasyUI的DataGird控件操作的JS代码*@
<script type="text/javascript">
    $(function () {
        var instanceID = $("#hID").val();
        var tag = "QualityManagement/QualityPlanList/Attachment";
        initTable(instanceID, tag);
    });

    function initTable(instanceID, tag) {
        $('#documentGrid').datagrid({
            //url: '/Document/GetDocumentList?instanceID=681764fd-aef8-4dcf-84bd-a2d700ffc9a0&Tag=Test',  //开发期测试
            url: '/Document/GetDocumentList?instanceID=' + instanceID + '&Tag=' + tag,  //运行期使用
            nowrap: true,
            autoRowHeight: true,
            striped: true,
            collapsible: true,
            rownumbers: true,
            remoteSort: false,
            idField: 'ID',
            singleSelect: true,
            //queryParams: queryData,
            columns: [[
                {
                    title: '文件名', field: 'FileName', width: 250,
                    formatter: function (value, row, index) {
                        return '<a href="' + row["FilePath"] + '">' + value + '</a> ';
                    }
                },
                { title: '文件大小', field: 'FileSize', width: 75, sortable: true },
                { field: 'UploadUserID', hidden: true },
                { title: '上传人', field: 'UploadUser', width: 80, sortable: true },
                { title: '上传时间', field: 'UploadTime', width: 130, sortable: true }

            ]],
            toolbar: '#documentToolBar'
        });
    }
</script>

<div class="frombox datagrid-body" style="padding-bottom: 5px;">
    <form id="circular-model" method="post">
        <table class="datagrid-btable" border="0" cellspacing="0" cellpadding="0">
            <tr class="datagrid-row">
                <td class="th">
                    <div class="datagrid-cell">预案名称</div>
                </td>
                <td class="td" colspan="5">
                    <div class="datagrid-cell">
                        <input name="PlanName" class="easyui-textbox" data-options="required:true" style="width:620px;" value="@Model.PlanName" readonly />
                    </div>
                </td>
            </tr>
            <tr class="datagrid-row">
                <td class="rth">
                    <div class="datagrid-cell">发布日期</div>
                </td>
                <td class="td">
                    <div class="datagrid-cell">
                        <input name="PublishTime" class="easyui-textbox" value="@Model.PublishTime" style="background:#eeeeee;" readonly />
                    </div>
                </td>
                <td class="th">
                    <div class="datagrid-cell">发布单位</div>
                </td>
                <td class="td">
                    <div class="datagrid-cell">
                        @*<input id="publishOrgID" name="PublishOrgID" class="easyui-textbox" value="@Model.PublishOrgID" readonly />*@
                        <input id="publishOrg" name="PublishOrg" class="easyui-textbox" value="@Model.PublishOrgName" style="background:#eeeeee;" readonly />
                    </div>
                </td>
                <td class="rth">
                    <div class="datagrid-cell">发布人</div>
                </td>
                <td class="td">
                    <div class="datagrid-cell">
                        <input name="PublishUserName" class="easyui-textbox" style="background:#eeeeee;" value="@Model.PublishUserName" readonly />
                    </div>
                </td>
            </tr>
            <tr class="datagrid-row">
                <td class="th">
                    <div class="datagrid-cell">摘要说明</div>
                </td>
                <td class="td" colspan="5">
                    <div class="datagrid-cell">
                        <textarea id="abstractDescription" name="AbstractDescription" cols="57" rows="5" style="width:620px;" readonly>@Model.AbstractDescription</textarea>
                    </div>
                </td>
            </tr>
            <tr class="datagrid-row">
                <td class="th">
                    <div class="datagrid-cell">附件</div>
                </td>
                <td class="td" colspan="5">
                    <div class="datagrid-cell">
                        <table id="documentGrid" style="height: 100px;"></table>
                    </div>
                </td>
            </tr>
        </table>
        <input id="hID" name="ID" type="hidden" value="@Model.ID" />
        <input id="hPublishUserID" name="PublishUserID" type="hidden" value="@Model.PublishUserID" />
    </form>
</div>
